package com.scms.secondclass.service.impl;

import java.util.List;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.scms.secondclass.mapper.SignRecordMapper;
import com.scms.secondclass.domain.SignRecord;
import com.scms.secondclass.service.ISignRecordService;

/**
 * 签到记录Service业务层处理
 */
@Service
public class SignRecordServiceImpl implements ISignRecordService 
{
    @Autowired
    private SignRecordMapper signRecordMapper;

    /**
     * 查询签到记录
     * 
     * @param signId 签到记录主键
     * @return 签到记录
     */
    @Override
    public SignRecord selectSignRecordBySignId(Long signId)
    {
        return signRecordMapper.selectSignRecordBySignId(signId);
    }

    /**
     * 查询签到记录列表
     * 
     * @param signRecord 签到记录
     * @return 签到记录
     */
    @Override
    public List<SignRecord> selectSignRecordList(SignRecord signRecord)
    {
        return signRecordMapper.selectSignRecordList(signRecord);
    }

    /**
     * 新增签到记录
     * 
     * @param signRecord 签到记录
     * @return 结果
     */
    @Override
    public int insertSignRecord(SignRecord signRecord)
    {
        signRecord.setCreateTime(new Date());
        return signRecordMapper.insertSignRecord(signRecord);
    }

    /**
     * 修改签到记录
     * 
     * @param signRecord 签到记录
     * @return 结果
     */
    @Override
    public int updateSignRecord(SignRecord signRecord)
    {
        signRecord.setUpdateTime(new Date());
        return signRecordMapper.updateSignRecord(signRecord);
    }

    /**
     * 批量删除签到记录
     * 
     * @param signIds 需要删除的签到记录主键
     * @return 结果
     */
    @Override
    public int deleteSignRecordBySignIds(Long[] signIds)
    {
        return signRecordMapper.deleteSignRecordBySignIds(signIds);
    }

    /**
     * 删除签到记录信息
     * 
     * @param signId 签到记录主键
     * @return 结果
     */
    @Override
    public int deleteSignRecordBySignId(Long signId)
    {
        return signRecordMapper.deleteSignRecordBySignId(signId);
    }
    
    /**
     * 根据报名ID查询签到记录
     * 
     * @param enrollmentId 报名ID
     * @return 签到记录
     */
    @Override
    public SignRecord selectSignRecordByEnrollmentId(Long enrollmentId)
    {
        return signRecordMapper.selectSignRecordByEnrollmentId(enrollmentId);
    }
    
    /**
     * 根据活动ID查询签到记录列表
     * 
     * @param activityId 活动ID
     * @return 签到记录集合
     */
    @Override
    public List<SignRecord> selectSignRecordByActivityId(Long activityId)
    {
        return signRecordMapper.selectSignRecordByActivityId(activityId);
    }
}